package ATM;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class Get extends JPanel implements ActionListener {
    private Atm frame;

    private JButton returnBut;//创建返回按钮对象
    private JButton confirmBut;//创建确认按钮对象
    public Get(Atm frame) {
        this.frame=frame;
        //空布局
        this.setLayout(null);
        //设置透明
        this.setOpaque(false);

        //返回按钮,返回菜单界面
        returnBut = new JButton("返回");
        returnBut.setBounds(250,280,100,50);
        this.add(returnBut);
        returnBut.addActionListener(this);

        //确认按钮,确认取款金额
        confirmBut = new JButton("确认");
        confirmBut.setBounds(450,280,100,50);
        this.add(confirmBut);

    }

    @Override
    public void actionPerformed(ActionEvent e) {
        if (e.getSource()==returnBut){
            frame.switchPanel("菜单");

        }
    }
}
